home *** CD-ROM | disk | FTP | other *** search
- /* args.h
-
- An abstract class to pass values to maplay and other worker
- threads.
-
- From the Win32 API, we can only pass one 32-bit value to a thread. This will
- be a pointer to a object of this class. The Args class contains the seeking
- control variables needed for both MPEG and MCI files.
-
- Added stop and done variables and functions for terminating the
- threads from outside.
-
- This class should be used to pass arguments to maplay(),
- and to initialize the Obuffer's. */
-
- #ifndef ARGS_H
- #define ARGS_H
-
- #ifdef __WIN32__
- #define STRICT
- #include <wtypes.h>
- #include <windows.h>
- #endif // __WIN32__
-
- #include "all.h"
- #include "ibitstr.h"
- #include "header.h"
-
- #ifdef SEEK_STOP
- #include "mutx_imp.h"
- #endif
-
- class Args
- {
- public:
-
- Args()
- {
-
- #ifdef SEEK_STOP
- mutex = NULL;
- stop = FALSE;
- done = FALSE;
- desired_position = 0;
- position_change = FALSE;
- #endif // SEEK_STOP
-
- #ifdef __WIN32__
- hWnd = NULL;
- #endif // __WIN32__
- }
-
- virtual ~Args() {}
-
- #ifdef SEEK_STOP
- _Mutex mutex;
- volatile BOOL stop;
- volatile BOOL done;
- volatile int32 desired_position;
- volatile BOOL position_change;
- #endif // SEEK_STOP
-
- #ifdef __WIN32__
- HWND hWnd;
- #endif // __WIN32__
-
- };
-
- // A class to contain arguments for maplay.
- class MPEG_Args : public Args
- {
- public:
-
- MPEG_Args()
- {
- stream = NULL;
- MPEGheader = NULL;
- which_c = both;
- use_own_scalefactor = FALSE;
- scalefactor = 32768.0;
-
- #ifdef __WIN32__
- phwo = NULL;
- #endif // __WIN32__
-
- #ifdef COMMAND_LINE
- stdout_mode = FALSE;
- #endif
-
- #if defined(SPARC) || defined(HPUX)
- use_speaker = FALSE;
- use_headphone = FALSE;
- use_line_out = FALSE;
- #endif // SPARC || HPUX
-
- #if defined(SPARC) && defined(ULAW)
- force_amd = FALSE;
- #endif // SPARC && ULAW
-
- #if defined(SPARC) || defined(HPUX) || defined(AIX)
- volume = -1.0f;
- #endif // SPARC || HPUX || AIX
-
- }
-
- Ibitstream *stream;
- Header *MPEGheader;
- enum e_channels which_c;
-
- BOOL use_own_scalefactor;
- real scalefactor;
-
- #ifdef __WIN32__
- HWAVEOUT *phwo;
- #endif // __WIN32__
-
- BOOL stdout_mode;
-
- #if defined(SPARC) || defined(HPUX)
- BOOL use_speaker;
- BOOL use_headphone;
- BOOL use_line_out;
- #endif // SPARC || HPUX
-
- #if defined(SPARC) && defined(ULAW)
- BOOL force_amd;
- #endif // SPARC && ULAW
-
- #if defined(SPARC) || defined(HPUX) || defined(AIX)
- float volume;
- #endif // SPARC || HPUX || AIX
-
- ~MPEG_Args() { }
- };
-
- #ifdef __WIN32__
- // A class to hold the arguments for MCI playing.
- class MCI_Args : public Args {
-
- public:
- MCI_Args()
- {
- playing = FALSE;
- }
-
- ~MCI_Args() { }
-
- volatile BOOL playing;
- };
- #endif // __WIN32__
-
- #endif // ARGS_H
-